import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        int[][] input = new int[n][n];
        for(int i = 0;i < n;i++) {
            for(int j = 0;j < 6;j++) {
                input[i][j] = sc.nextInt();
            }
        }
        int[][] op = new int[q][2];
        for (int i = 0;i < q;i++) {
            for (int j = 0;j < 2;j++) {
                op[i][j] = sc.nextInt();
            }
        }
        sc.close();

    }
}